home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / include / net / raw_cb.h < prev    next >
C/C++ Source or Header  |  1988-10-23  |  2KB  |  67 lines

  1. /*
  2.  * Copyright (c) 1980, 1986 Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms are permitted
  6.  * provided that this notice is preserved and that due credit is given
  7.  * to the University of California at Berkeley. The name of the University
  8.  * may not be used to endorse or promote products derived from this
  9.  * software without specific prior written permission. This software
  10.  * is provided ``as is'' without express or implied warranty.
  11.  *
  12.  *    @(#)raw_cb.h    7.2 (Berkeley) 12/30/87
  13.  */
  14.  
  15. #ifndef _RAW_CB
  16. #define _RAW_CB
  17.  
  18. /*
  19.  * Raw protocol interface control block.  Used
  20.  * to tie a socket to the generic raw interface.
  21.  */
  22. struct rawcb {
  23.     struct    rawcb *rcb_next;    /* doubly linked list */
  24.     struct    rawcb *rcb_prev;
  25.     struct    socket *rcb_socket;    /* back pointer to socket */
  26.     struct    sockaddr rcb_faddr;    /* destination address */
  27.     struct    sockaddr rcb_laddr;    /* socket's address */
  28.     struct    sockproto rcb_proto;    /* protocol family, protocol */
  29.     caddr_t    rcb_pcb;        /* protocol specific stuff */
  30.     struct    mbuf *rcb_options;    /* protocol specific options */
  31.     struct    route rcb_route;    /* routing information */
  32.     short    rcb_flags;
  33. };
  34.  
  35. /*
  36.  * Since we can't interpret canonical addresses,
  37.  * we mark an address present in the flags field.
  38.  */
  39. #define    RAW_LADDR    01
  40. #define    RAW_FADDR    02
  41. #define    RAW_DONTROUTE    04        /* no routing, default */
  42.  
  43. #define    sotorawcb(so)        ((struct rawcb *)(so)->so_pcb)
  44.  
  45. /*
  46.  * Nominal space allocated to a raw socket.
  47.  */
  48. #define    RAWSNDQ        2048
  49. #define    RAWRCVQ        2048
  50.  
  51. /*
  52.  * Format of raw interface header prepended by
  53.  * raw_input after call from protocol specific
  54.  * input routine.
  55.  */
  56. struct raw_header {
  57.     struct    sockproto raw_proto;    /* format of packet */
  58.     struct    sockaddr raw_dst;    /* dst address for rawintr */
  59.     struct    sockaddr raw_src;    /* src address for sbappendaddr */
  60. };
  61.  
  62. #ifdef KERNEL
  63. struct rawcb rawcb;            /* head of list */
  64. #endif
  65.  
  66. #endif /* _RAW_CB */
  67.